added samples
[windows-sources.git] / sdk / samples / all in on code / Visual Studio 2008 / VBBrowserHelperObject / HTMLEventHandler.vb
blob9eef7f0a26af6282ba134121d26e22fd28feb05e
1 '*************************** Module Header ******************************'
2 ' Module Name: HTMLEventHandler.vb
3 ' Project: VBBrowserHelperObject
4 ' Copyright (c) Microsoft Corporation.
5 '
6 ' This ComVisible class HTMLEventHandler can be assign to the event properties
7 ' of DispHTMLDocument interfaces, like oncontextmenu, onclick and so on. It can
8 ' also be used in other HTMLElements.
9 '
11 ' This source is subject to the Microsoft Public License.
12 ' See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
13 ' All other rights reserved.
15 ' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
16 ' EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
17 ' WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
18 '*************************************************************************'
20 Imports System.Runtime.InteropServices
22 ' The delegate of the handler method.
23 Public Delegate Sub HtmlEvent(ByVal e As mshtml.IHTMLEventObj)
25 <ComVisible(True)> _
26 Public Class HTMLEventHandler
28 Private htmlDocument As mshtml.HTMLDocument
30 Public Event eventHandler As HtmlEvent
32 Public Sub New(ByVal htmlDocument As mshtml.HTMLDocument)
33 Me.htmlDocument = htmlDocument
34 End Sub
36 <DispId(0)> _
37 Public Sub FireEvent()
38 RaiseEvent eventHandler(Me.htmlDocument.parentWindow.event)
39 End Sub
40 End Class